<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>您身边真实有效的折扣、外卖、特色商户信息 - 未央店</title>
<link rel="stylesheet" href="css/general.css" type="text/css" />
<link rel="stylesheet" href="css/layout.css" type="text/css" />
<link rel="stylesheet" href="css/liaoshi.css" type="text/css" />
<link rel="stylesheet" href="css/shanghulist.css" type="text/css" />
<link rel="stylesheet" href="css/plugin_baixingfeedback_css/feedback.css" type="text/css" />
<link rel="shortcut icon" href="images/favicon.ico" />

<script type="text/javascript" src="js/jquery_1.7.1.js"></script>
<script type="text/javascript" src="js/plugin_DOMWindow_js/jquery.DOMwindow.js"></script>
<script type="text/javascript" src="js/sel_content_detail.js"></script>
<script type="text/javascript" src="js/sel_industry.js"></script>
<script type="text/javascript" src="js/plugin_baixingfeedback_js/baixing_feedback.js"></script>
</head>
<?php
$fromLM = '6';
if( isset($_GET['fromLM']) )
{
	$fromLM = $_GET['fromLM'];
}
$LM_Pic = '';
$LM_Name = '';
$shanghu_list = '';
switch ($fromLM)
{
	case '1':  //代表来自于id为1的LM，即上海大学（宝山校区）
		$LM_Pic = 'shangda_logo.jpg';
		$LM_Name = '上海大学<span style="font-size:14px;font-weight:light;">（宝山校区）</span>';
		$shanghu_list = 'shangda_baoshan_shanghulist.php';
	    break;

	case '6':  //代表来自于id为6的LM，即辽宁师范大学
		$LM_Pic = '3_02.gif';
		$LM_Name = '辽宁师范大学';
		$shanghu_list = 'liaoshi_shanghulist.php';
	    break;

	default:
		$LM_Pic = '3_02.gif';
		$LM_Name = '辽宁师范大学';
		$shanghu_list = 'liaoshi_shanghulist.php';
		break;
}

$keyword=null;
if( isset($_GET['input']) )
{
	$keyword = stripslashes( trim($_GET['input']) );
}
?>
<body>
<div id="wrap">

<div id="reg">
  <div id="top_nav" style=" width: 980px; margin-left:auto; margin-right:auto; text-align:right;">
    <span><a href="http://127.0.0.1:8005/shanghu_login.php">[商家登录]</a></span>
  
    <span><a href="http://127.0.0.1:8005/shanghu_reg.php">[商家注册]</a></span>
  </div>
</div>

<div id="container">

  <div class="sep"></div>

  <div id="header">
    <div id="logo">
	  <a href="./"><img src="images/jiayi_logo.jpg" width="200px" height="75px" alt="logo" style="border:0px;"/></a>
	</div>

    <div id="city_change">
	  <div id="city_pic">
	    <img src="images/<?php echo $LM_Pic; ?>" width="140px" height="70px" />
      </div>
	  <div id="city_box">
	    <br /><span style="font-size:20px; font-weight:bold; margin-left:20px;"><?php echo $LM_Name; ?></span><br />
		<a href="#more_city" id="change"><span style="margin-left:60px;padding-right:12px;background:url(images/g.header.v201203221438.png) no-repeat right -480px ;">
		切换学校</span></a>
        <script type="text/javascript"> 
		$('#change').openDOMWindow({   //对弹出框DOMWindow进行设置
		eventType:'click', 
		loader:1, 
		loaderImagePath:'animationProcessing.gif', 
		loaderHeight:0, 
		loaderWidth:0,
		height:330,
		width:500,
		}); 
		</script>

		<!--更多城市-->
		<div id="more_city">
          <div style="float:right;">点击框外任意处退出X</div>
		  <div class="sep" style="height:5px;"></div>
		  <div id="school_list">
		    <p style="font-size:20px; font-weight:bold;">上海：</p><br />
			<ul>
			  <li><a href="./shangda_baoshan.php">上海大学（宝山校区）</a></li>
			  <li><a href="#">复旦大学</a></li>
			  <li><a href="#">同济大学（四平校区）</a></li>
			  <li><a href="#">上海外国语大学</a></li>
			</ul>
		  </div>
		  
		  <div id="school_list">
		    <p style="font-size:20px; font-weight:bold;">大连：</p><br />
			<ul>
			  <li><a href="./liaoshi.php">辽宁师范大学</a></li>
			  <li><a href="#">东北财经大学</a></li>
			  <li><a href="#">大连理工大学</a></li>
			  <li><a href="#">大连海事大学</a></li>
			</ul>
		  </div>
	    </div><!--more_city结束-->

	  </div>  
	</div>
	
	<div id="search">
	  <form action="./searchbox.php" method="get" target="_blank">
	    <input id="input" type="text" name="input" value="<?php echo $keyword;?>"/>
		<input type="hidden" name="fromLM" value="<?php echo $fromLM;?>" />
		<input type="hidden" name="page" value="1" />
		<input id="button" type="submit" name="" value="" onclick="if(input.value==''){alert('您还没有输入任何内容');return false;}else{return true;}"/>
	  
	  </form>
	</div>
	
	<div class="sep"></div>
	
	<div id="nav">
	  <div id="nav_left"></div>
	  
	  <div id="nav_mid">
	    <ul>
	      <li style="border-left:1px solid #0C75A0" class="selected"><a href="./">首页</a></li>
		  <!--li><a href="#">待定</a></li-->
		  <!--li><a href="#">待定</a></li-->
		  <!--li><a href="#">待定</a></li-->
		  <!--li><a href="#">待定</a></li-->
	    </ul>
	  </div>
	  
	  <div id="nav_right"></div>
	</div>
	
	<div id="nav_shade"></div>
  </div><!--header结束-->


  <div class="sep"></div>

  <div id="main">
    <div id="left">
	  <div class="card industry_select">
	    <div class="title1">
		  <span>选择行业</span>
		</div>
		<div class="content">
		  <ul>
		    <li><div class="no_border"><div class="word">休闲旅游</div><div class="arrow">></div></div>
			  <div class="content_detail">
			    <ul>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=2&page=1&industryName=KTV">KTV</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=3&page=1&industryName=咖啡厅">咖啡厅</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=4&page=1&industryName=酒吧">酒吧</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=5&page=1&industryName=电影院">电影院</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=6&page=1&industryName=景点">景点</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=7&page=1&industryName=足疗按摩">足疗按摩</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=8&page=1&industryName=游乐游艺">游乐游艺</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=10&page=1&industryName=洗浴">洗浴</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=12&page=1&industryName=DIY手工坊">DIY手工坊</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=13&page=1&industryName=温泉">温泉</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=14&page=1&industryName=滑雪场">滑雪场</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=15&page=1&industryName=旅行社">旅行社</a></li>
				</ul>
			  </div>
			</li>
			<li><div class="no_border"><div class="word">运动健身</div><div class="arrow">></div></div>
			  <div class="content_detail">
			    <ul>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=17&page=1&industryName=羽毛球馆">羽毛球馆</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=18&page=1&industryName=台球馆">台球馆</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=20&page=1&industryName=网球场">网球场</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=21&page=1&industryName=保龄球馆">保龄球馆</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=22&page=1&industryName=乒乓球馆">乒乓球馆</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=23&page=1&industryName=瑜伽">瑜伽</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=25&page=1&industryName=舞蹈">舞蹈</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=26&page=1&industryName=游泳馆">游泳馆</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=27&page=1&industryName=健身馆">健身馆</a></li>
				</ul>
			  </div>
			</li>
			<li><div class="no_border"><div class="word">宾馆住宿</div><div class="arrow">></div></div>
			  <div class="content_detail">
			    <ul>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=29&page=1&industryName=日租">日租</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=30&page=1&industryName=长租">长租</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=31&page=1&industryName=经济型宾馆">经济型宾馆</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=32&page=1&industryName=连锁宾馆">连锁宾馆</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=33&page=1&industryName=星级宾馆">星级宾馆</a></li>
				</ul>
			  </div>
			</li>
			<li><div class="no_border"><div class="word">教育培训</div><div class="arrow">></div></div>
			  <div class="content_detail">
			    <ul>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=35&page=1&industryName=英语培训">英语培训</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=36&page=1&industryName=IT培训">IT培训</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=37&page=1&industryName=留学">留学</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=38&page=1&industryName=考研培训">考研培训</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=39&page=1&industryName=小语种培训">小语种培训</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=40&page=1&industryName=MBA培训">MBA培训</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=41&page=1&industryName=乐器培训">乐器培训</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=42&page=1&industryName=公务员培训">公务员培训</a></li>
				</ul>
			  </div>
			</li>
			<li><div class="no_border"><div class="word">购物</div><div class="arrow">></div></div>
			  <div class="content_detail">
			    <ul>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=44&page=1&industryName=品牌折扣店">品牌折扣店</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=46&page=1&industryName=眼镜店">眼镜店</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=47&page=1&industryName=化妆品">化妆品</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=48&page=1&industryName=蛋糕店">蛋糕店</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=49&page=1&industryName=运动户外">运动户外</a></li>
				</ul>
			  </div>
			</li>
			<li><div class="no_border"><div class="word">爱美丽</div><div class="arrow">></div></div>
			  <div class="content_detail">
			    <ul>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=51&page=1&industryName=美发">美发</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=52&page=1&industryName=美甲">美甲</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=53&page=1&industryName=美容/SPA">美容/SPA</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=54&page=1&industryName=瘦身纤体">瘦身纤体</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=55&page=1&industryName=个性写真">个性写真</a></li>
				</ul>
			  </div>
			</li>
			<li><div class="no_border"><div class="word">生活服务</div><div class="arrow">></div></div>
			  <div class="content_detail">
			    <ul>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=57&page=1&industryName=餐饮">餐饮</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=60&page=1&industryName=快照/复印">快照/复印</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=61&page=1&industryName=齿科">齿科</a></li>
				  <li><a target="_blank" href="./<?php echo $shanghu_list; ?>?landMarklBuildingId=<?php echo $fromLM;?>&industryId=62&page=1&industryName=搬家">搬家</a></li>
				</ul>
			  </div>
			</li>
			<!--li><div class="no_border"><div class="word">更多</div><div class="arrow">></div></div>
			  <div class="content_detail"></div>
			</li-->
		  </ul>
		</div>
	  </div> <!--card结束-->
	  
	  <div class="sep">
	  </div>

	</div><!--left结束-->

	<div id="middle">
	  <div class="card">
		<div class="title1"><span><?php echo $keyword." " ?>搜索结果</span></div>

		<div id="sort_type">
		  <span style="float:left; margin-left:10px;">排序方式：</span>
		  <ul>
			<li>距您最近</li>
		  </ul>
		</div>

		<div class="sep"></div>

		<!--div class="one_info">
		  <ul>
		    <li><span>名称：</span><span class="shanghu_name"><a target="_blank" href="http://www.baidu.com">XXXX望湘园(第一百货店)</a></span>[1000米]<span class="shanghu_page"></span></li>
		    <li><span style="color: #666;">地址：</span><span>黄浦区南京东路830号第一百货新楼6楼</span></li>
		    <li><span style="color: #666;">最新留言：</span><span>亲们！4月10日至4月13日，会员优惠8折起，赶紧来办会员卡吧，亲！</span></li>
		  </ul>
		  <div class="sep"></div>
		</div>

		

		<div class="one_info">
		  <ul>
		    <li><span>名称：</span><span class="shanghu_name"><a target="_blank" href="http://www.baidu.com">XXXX望湘园sdfsfsfs(第二百货店)</a></span>[2000米]<span class="shanghu_page"></span></li>
		    <li><span style="color: #666;">地址：</span><span>黄浦区南京东路830号第一百货新楼6楼</span></li>
		    <li><span style="color: #666;">最新留言：</span><span>亲们！4月10日至4月13日，会员优惠8折起，赶紧来办会员卡吧，亲！</span></li>
		  </ul>
		  <div class="sep"></div>
		</div>

		<div class="one_info">
		  <ul>
		    <li><span>名称：</span><span class="shanghu_name"><a target="_blank" href="http://www.baidu.com">XXXX望湘园sdfsfsfs(第二百货店)</a></span>[2000米]<span class="shanghu_page"></span></li>
		    <li><span style="color: #666;">地址：</span><span>黄浦区南京东路830号第一百货新楼6楼</span></li>
		    <li><span style="color: #666;">最新留言：</span><span>亲们！4月10日至4月13日，会员优惠8折起，赶紧来办会员卡吧，亲！</span></li>
		  </ul>
		  <div class="sep"></div>
		</div>

		<div class="one_info">
		  <ul>
		    <li><span>名称：</span><span class="shanghu_name"><a target="_blank" href="http://www.baidu.com">XXXX望湘园sdfsfsfs(第二百货店)</a></span>[2000米]<span class="shanghu_page"></span></li>
		    <li><span style="color: #666;">地址：</span><span>黄浦区南京东路830号第一百货新楼6楼</span></li>
		    <li><span style="color: #666;">最新留言：</span><span>亲们！4月10日至4月13日，会员优惠8折起，赶紧来办会员卡吧，亲！</span></li>
		  </ul>
		  <div class="sep"></div>
		</div-->

		
		<?php
		  /*$json_data = '[[{"partyName":"chuchu\u695a\u7559\u9999",
						   "pageUrl":"http:\/\/www.ddmap.com\/map\/21\/point-718756-%D0%C4%E2%F9-.htm",
						   "facility":"\u5f90\u6c47\u533atianyaolu333hao",
						   "message":"Come on qing!"},
						  {"partyName":"DB\u671b\u6e58\u56ed(\u7b2c\u4e8c\u767e\u8d27\u5e97)",
						   "pageUrl":"http:\/\/www.dianping.com\/shop\/5449482?KID=105285",
						   "facility":"\u5f90\u6c47\u533a\u8679\u6865\u8def1\u53f7\u6e2f\u6c47\u6052\u9686\u5e7f\u573a\u7f8e\u98df\u8857(\u534e\u5c71\u8def\u53e3)",
						   "message":"\u4e94\u4e00\u5927\u51cf\u4ef7\u5566\uff0c\u6e58\u83dc\u65b0\u54c1\u4e0a\u5e02\uff0c\u5feb\u6765\u54c1\u5c1d\u5427\uff0c\u4eb2\uff01"}],1]';
		  $obj = json_decode(($json_data));*/

		  //定义一个函数，给$str中的关键字$kw，加上标签，使其显示为$color色。
		  function color_keyword( $str, $kw, $color )
		  {
			  $len = strlen($kw);

			  $r='';
			  while(1)
			  {
				  $pos = stripos($str,$kw,0); //匹配第一次出现子串的位置
				  if( $pos === false )  //说明没有找到$kw子串
				  {
					  $r.= $str;
					  break;
				  }
				
				  //说明找到$kw子串，得到了一个具体的$pos。
				  $strleft = substr($str,0, $pos+$len); //取出子串及子串左边的串
				  $str = substr($str,$pos+$len); //子串右边的串还赋给$str

				  //处理$strleft，给里面的关键字加上颜色标签。
				  $sub = substr($strleft, $pos, $len);
				  $replacement = '<span style="color:'.$color.';">'.$sub.'</span>';
				  $strleft = substr_replace($strleft, $replacement, $pos, $len );
				  $r.=$strleft;
			  }
			  return $r;
		  }

		  require_once(dirname(__FILE__)."/../include/httpclient.php");
		  
		  $hasPageNum = true;
		  if( isset($_GET['input']) && $keyword != null && isset($_GET['page']) )
		  {
			  $arg = array( "input" => urlencode( $keyword ),
				            "page" => $_GET['page'],
							"LM" => $fromLM
						  );

			  $json_data = call_serviceurl(103, $arg);

			  $obj = json_decode(($json_data));

			  if( count($obj[0]) == 0 ) //即没有找到任何商家
			  {
				  echo "没有找到满足条件的商户。";
				  $hasPageNum = false;
			  }
			  else
			  {
				  for($i=0; isset($obj[0][$i]); $i++)
			      {
					  //先处理一下$obj[0][$i]的partyName和message，让匹配的关键字用红色显示
					  
					  /*$old = $keyword;
					  $new = '<span style="color:red;">'.$old.'</span>';
					  $partyName = str_ireplace($old , $new , $obj[0][$i]->partyName);
					  $message = str_ireplace($old , $new , $obj[0][$i]->message);*///这个方法存在大小写问题。如果partyName里是大写KTV，而搜索的是小写ktv，则最终显示的页面中也是小写ktv。

					  $partyName = color_keyword($obj[0][$i]->partyName, $keyword, 'red');
					  $message = color_keyword($obj[0][$i]->message, $keyword, 'red');//特地写的函数color_keyword，就是为了解决大小写的问题。保存partyName和message里大小写不变。
					  
					  $distance = $obj[0][$i]->distance."公里";
					  if( $obj[0][$i]->distance < 0 ) //说明距离是负数，代表较远。或者库里没有存相应的距离。
					  {
						  $distance = "较远";
					  }
					  //组装成一个商家的搜索结果
					  $one_info = '<div class="one_info">
					  <ul>
						<li><span style="color: #666;">名称：</span><span class="shanghu_name"><a target="_blank" href="'.$obj[0][$i]->pageUrl."&fromLM=1".'">'.$partyName.'</a></span>['.$distance.']<span class="shanghu_page"></span></li>'.
						'<li><span style="color: #666;">地址：</span><span>'.$obj[0][$i]->facility.'</span></li>'.
						'<li><span style="color: #666;">最新留言：</span><span>'.$message.'</span></li>'.
						'</ul>
						 <div class="sep"></div>
					   </div>';

					   echo $one_info;
			      }

			  }
		  }
		  else if( isset($_GET['input']) && $keyword == null )
		  {
			  echo "您搜索的内容为空，请写入具体内容再搜。";
			  $hasPageNum = false;
		  }
		  else //缺少参数
		  {
			  echo "url缺少参数";
			  $hasPageNum = false;
		  }
		?>
	  </div><!--card结束-->
	  <div class="pagenum" style="">
	    <ul>
			<?php  //这段php是为了动态生成页码，以及上一页、下一页、首页、尾页等。
			if( $hasPageNum )  //至少有一页，并且url参数都正确时
			{
				$curpage = $_GET['page'];
			    $firstpage=1;
			    $lastpage=$obj[1];

				if($curpage > $lastpage)
				  $curpage = $lastpage;  //不让当前页超过最大页
				else if($curpage<$firstpage)
				  $curpage = $firstpage; //不让当前页小于第一页

				$hasFirstPage = true;
				$hasLastPage = true;
				$hasPrePage = true;
				$hasNextPage =true;

				$pagenum = '';

				for($i=4; $i>=1; $i--)
				{
					$leftpage = $curpage-$i;
					if( $leftpage <= 0 )
					{
						continue;
					}
					if( $leftpage == 1 )
						$hasFirstPage = false;
					$href = "./searchbox.php?input=".$keyword."&fromLM=".$fromLM."&page=".$leftpage;
					$pagenum = $pagenum.'<a href="'.$href.'"><li class="unhover">'.$leftpage.'</li></a>';

				}

				$pagenum = $pagenum.'<a><li class="selected">'.$curpage.'</li></a>';

				for( $i=1; $i<=4; $i++ )
				{
					$rightpage = $curpage+$i;
					if( $rightpage > $lastpage )
						break;

					$href = "./searchbox.php?input=".$keyword."&fromLM=".$fromLM."&page=".$rightpage;
					$pagenum = $pagenum.'<a href="'.$href.'"><li class="unhover">'.$rightpage.'</li></a>';

					if( $rightpage == $lastpage )
						$hasLastPage = false;


				}

				if( $curpage == 1 )
					$hasFirstPage = false;
				if( $curpage == $lastpage )
					$hasLastPage = false;

				if( $curpage == 1 )
					$hasPrePage = false;

				if( $curpage == $lastpage )
					$hasNextPage = false;

				if( $hasFirstPage == true )
				{
					$href = "./searchbox.php?input=".$keyword."&fromLM=".$fromLM."&page=".$firstpage;
					$pagenum = '<a href="'.$href.'"><li class="unhover" style="background-color: #F2F2F2; width:50px;">首页</li></a>'.$pagenum;
				}

				if( $hasLastPage == true )
				{
					$href = "./searchbox.php?input=".$keyword."&fromLM=".$fromLM."&page=".$lastpage;
					$pagenum = $pagenum.'<a href="'.$href.'"><li class="unhover" style="background-color: #F2F2F2; width:50px;">尾页</li></a>';
				}

				if( $hasPrePage == true )
				{
					$href = "./searchbox.php?input=".$keyword."&fromLM=".$fromLM."&page=".($curpage-1);
					$pagenum = '<a href="'.$href.'"><li class="unhover" style="background-color: #F2F2F2; width:50px;">上一页</li></a>'.$pagenum;
				}

				if( $hasNextPage ==true )
				{
					$href = "./searchbox.php?input=".$keyword."&fromLM=".$fromLM."&page=".($curpage+1);
					$pagenum = $pagenum.'<a href="'.$href.'"><li class="unhover" style="background-color: #F2F2F2; width:50px;">下一页</li></a>';
				}

				echo $pagenum;
			}
			?>
        </ul>
	  </div>

	</div><!--middle结束-->

	<div id="right"> 
	  
	  <div class="card">
	    <div class="title1">
		</div>
	  </div>
	</div>


  </div><!--main结束-->

  <div class="sep"></div>

  <div id="footer">
    <ul>
	  <li><a href="./about.php?item=0" target=_blank>关于我们</a>|</li>
	  <li><a href="./about.php?item=1" target=_blank>联系我们</a>|</li>
	  <li><a href="./about.php?item=2" target=_blank>推广服务</a>|</li>
	  <li><a href="./about.php?item=3" target=_blank>人才招聘</a>|</li>
	  <li><a href="./about.php?item=4" target=_blank>友情链接</a></li>
    </ul>
	<br />
    Copyright(c) 2013 weiyangdian.com All Rights Reserved
  </div>

</div><!-- container结束 -->

</div><!-- wrapr结束 -->

<!-- 这一段div是页面右侧的悬浮“反馈与建议” -->
<div class="fixedBtn">
	<a rel="nofollow" href="###" class="feedback" title="欢迎给JquerySchool找问题和提建议～">意见反馈</a>
	<a href="#top" class="top" title="回到顶部">回到顶部</a>
	<div class="feedbackTips fb-open hide green">
		反馈已发送！
	</div>
	<div class="feedbackCnt">
		<h3><cite class="red">* </cite>您对网站意见和建议：</h3>
		<form action="./feedback.php" method="get" target="_blank">
			<textarea id="fb_text" name="feedbackCnt">提示：如果您能够留下联系方式，将有助于我们更好地处理问题，谢谢啊亲～</textarea>			
			<input id="real_sub" type="submit" name="" value="" style="display:none;"/>
			<span id="fb_sub" class="button button-green button-medium">提交反馈</span>
		</form>
	</div>
</div>
<!-- 这一段div是页面右侧的悬浮“反馈与建议”  -->

</body>
</html>